Music Taste over Time: the Story of a Playlist


The corpus that I have chosen is one of my personal playlists (songs: 406), one that I’ve started together with my girlfriend when we started dating and which we’ve been curating together ever since (the playlist is called SN, an acronym for Savannah, Nick and it can be found here). Considering that we’ve been actively updating this playlist for years, I would like to know if our music taste has changed from when we started the playlist.

This portfolio tells the story of what I’ve found.


First, we need to be able to compare the old with the new. As such, I’ve split up SN into two parts: the first 100 songs added to the playlist (SN old) and the latest 100 additions (SN new). The graph on the left shows if there are meaningful differences between the means of a selection of Spotify audio features of SN old and SN new. Red lines indicate strong effects (> 0.5 standard deviations of change) whereas orange lines indicate medium effects (> 0.2 - < 0.5 standard deviations of change).

The graph seems to show that our music taste has become happier over time: danceability has gone up and valence has experienced a sharp rise. Only looking at a difference in means, however, doesn’t tell us how the distributions of these features have evolved over time…

Happier Songs Over Time: The Great Migration of the Density Blob


On the left is a plot that shows how the distribution of the danceability and valence features has shifted over time. The first panel represents SN old (first 100 songs) and the last panel plots SN old (last 100 songs). To further show how the density of songs on these two dimensions has moved over time, I added a mid panel which I called SN mid, representing a 100 songs that were added in between SN old and new.

The strongest shift can be seen in the valence feature: whereas the majority of songs added in the beginning of the playlist are categorized as sad, with valences centering between 0.1-0.4, the latest songs added show virtually no focus at this region and include songs that explore the upper end of the continuum. Danceability too, has made a shift, albeit less strong than the valence feature.

What might have caused this shift in sound?

Forever Hipster: Were we Influenced by Newly Released Music?


One possibility as a cause for this shift in distribution is the influence of newly released music. Possibly the shift in playlist sound has less to do with a change in me and my girlfriend but rather has something to do with what is the latest and greatest music that’s being released at any given time.

The plot below shows that this is probably not the case. The date that songs were added are plotted against the time that they were released to see if there is a relationship between these two variables. To further underline this, I plotted a regression line which turned out almost completely flat. The plot further shows the distribution of the popularity of the tracks added over time, there seems to be a little bit of an overrepresentation of popular songs towards the latest additions but overall there seems to be a roughly equal distribution of popular/unpopular songs at any point in time.

Have we Found our True Sound?: Personal Means Convergence


It is my experience that collaborative playlists often have to find their stride. It takes some time to figure out what kind of sound a particular playlist should have and in its early days some additions of the participants can fail to line up in style. But after everyone has tested the water, often without explicitly agreeing about it with eachother, a sound is found and the styles converge.

Could it perhaps be that the difference between SN old and SN new is simply due to SN old encapsulating the unsure early days of the playlist and SN new representing the true sound of SN? The plot on the left offers some evidence for this hypothesis. It plots how the means of additions made by Sav or me, developed over time. The x-axis plots the course of time while the y-axis plots the mean value of both the danceability and valence features. As can be seen in the plot, SN old was characterized by some disagreement about where the playlist should go but after a little while we found our sound and settled on what the playlist should be.

This plot comes with a caveat: the means represented in SN old are based on much less data than the means of SN new, possibly exaggerating the differences. However, when plotting the mean differences based only on songs from SN new, there is still less of a discrepancy between the means compared to SN old.

Discovering the Sound of SN via Chromagrams


Let’s take a bit of a sidetour and focus on what is typical of the sound of SN as a whole. A first way of doing this is by looking at the musical information contained in typical and atypical songs of SN.

On the left two chromagrams are plotted. These objects plot how sound energy is distributed over the classic Western 12 pitch classes at every given timepoint of a recording. A vertical slice of one of these chromagrams is a snapshot in time and shows how much or little energy is present for each note of the 12-note tonescale. These chromagrams were normalized by using the euclidean method.

The top chromagram plots a very typical SN song (Slowly by Max Sedgley), based on the features: danceability, valence and energy. Typicality, here, was determined by finding a song with a very small average z-value (<|.01|) for the aforementioned features. The same was done in reverse to find an atypical song: the below chromagram plots a song (the Rainbow by Talk Talk) with a high average z-value (>|1.5|) for these three features.

What stands out from these chromagrams is that Slowly is much more repetitive than the Rainbow. This would make sense because SN is mostly a playlist intended to enjoy when hanging out with friends and chilled more repetitive music is more suited for this than very dynamic tracks.

Again and Again: Is SN charachterized by Repetitive Music?


The chromagrams of last week suggested that a typical SN song is more repetitive than an atypical song (measured by average z-value of danceability, valence and energy features). To further inspect this hypothesis, I plotted self similarity matrices (SSM) for three atypical songs (z-value >|1.5|) and three typical songs (z-value <|.01|). It was quite suprising how effective this method was, especially the atypical songs I would personally rate as outliers of the playlist as well. The typical songs do not fully represent the sound of the entire playlist in my opinion but they absolutely represent a common sound of it.

In this case, the SSM’s plot timbre features for all songs, which were normalized via the Euclidean method. Although timbre features are not typically normalized, the Euclidean normalization yielded more pronounced visualizations. To summarize these features, a normal arithmetic mean was used and cosine distances were calculated to determine similarity.

As can be seen from the plots, the atypical songs seem to have more dynamic structures, shown by the complex checkered patterns that characterize these plots. However, the song the Farewell is less pronounced in this respect. In contrast, the typical songs overall seem to have fairly repetitive structures, though Why Don’t You is again an exception to this pattern.

All in all, there seems to be some support for the idea that SN is characterized by repetitive music but this is rather a tendency than a rule as the SSM’s show less of a stark difference than might be expected.

Is SN Characterized by Repetitive Music? Part 2: Tempograms


The self-similarity matrices resulted in non-conclusive results regarding the idea that SN is characterized by more steady and repetitive music and that more dynamic music is more atypical for the playlist. To chase this idea a little further, we can make the same comparisons but this time using tempograms. These objects plot the development of tempo over time for individual songs. On the left the different tempograms are plotted for the same typical and atypical songs as the previous tab. Unfortunately, these plots don’t get us much further. The songs Why Don’t You and Farewell again contradict that typical SN songs are more steady and atypical more steady. However, the remaining fours songs do, yet again, support the idea as the tempograms for the typical songs the Chain and Slowly show a much more steady line than the atypical songs the Rainbow and Cherry Blossom.

This is Getting Repetitive: Is SN Repetitive or Not?


With the very real risk of getting repetitive myself, I want to give the theory that steady music is typical and dynamic music atypical for SN one more shot. The tempograms of the previous slide are plotted on the basis of power distributions over all the possible bpm’s at every point in time of a song. When a tempogram shows a clear and steady tempo we can expect the density plot of this power vector to have lower spread than for a tempogram that shows a lot of fluctuation of tempo over time. As such, I’ve plotted density curves of this power column for 5 typical and atypical songs (selected again on the basis of the same z-values as before). The “butterfly” plot on the left shows the results. Although there are some exceptions, overall it can be seen that the density plots of atypical songs have a wider spread than those of the typical songs, which show more peaked and narrow density distributions. This suggests that, indeed, SN is characterized by music with a more steady flow. However, in order to truly answer this question, I would have to analyze many more songs and I would need to include many more features in the analysis. Due to a lack of time, I could not go that far into the corpus for this portfolio.

Harmonic Structure: the Remarkable Regularity of our Preferred Chords


Okay, back to comparing SN old with SN new. Chromagrams allow us to do more than just detect the structure of songs. We can compare a song’s chromagram to templates that describe chords. These templates are made by constructing a vector with 1’s at chromas that correspond with the notes in a chord and 0’s at all the other chromas. When we compare our chromagram at all points in time with these templates we can calculate distances between them and, in turn, estimate which chord is being played.

Using this technique (and a whole lot of data wrangling) I plotted the average prevalence of common chords in the 100 songs of SN new and SN old. Below this text I added some explanation on how I roughly did this.

More importantly: what did I find? This is what’s plotted on the left. Something quite remarkable revealed itself: it seems that the distribution of chords has hardly changed at all over time! The most common chords in SN old are virtually the same as SN new and the same goes for ‘rare’ chords within each playlist. This can mean a few things: Savannah and I can implicitly hear which chords are being played in a song and base our song preferences on this intuition subconsciously OR the algorithm used to analyze the chords is biased towards detecting certain chords. I will leave it up to the reader to decide what to believe!

Additionally to that, it seems that my girlfriend and I prefer (seventh) chords over simple triads, this is shown by the over-representation of seventh chords in the top half of the plot.

Explanation: I summed the distances of all the timepoints in each song to estimate which chords are most frequently played over the whole song (low sum values corresponding with more frequent chords). I did this for each song in SN old and SN new (using Euclidean normalization and Manhattan distance). What resulted was a large dataframe that has the songs of each playlist in the rows and all the common major/minor triads and seventh chords in the columns. The dataframe itself is filled up with summed distances. If we take the mean of each column then we can get an idea of the prevelance of each chord for each playlist. One last thing: in order to meaningfully compare the playlists, I normalized the distances by dividing them with the max value of each playlist. This effectively converts the distances into proportions.

Can a Computer Differentiate Between Old and New?


To conclude this tour of our playlist and to reach a conclusion whether its style has changed over time, we can try to build a model that attempts to classify songs in SN old or SN new. After all, if a machine is able to ‘teach’ itself what differentiates old and new tracks in our playlist, then we can add that fact as more evidence that SN’s style has changed over time.

Because we’re dealing with a binary classification task, I decided to train a penalized logistic regression model. To train the model (with 10 fold cross-fold validation using a 70/30 split, repeated 3 times) I used the R package caret. Via trial and error I eventually used the following predictors, as these resulted in the best model: energy, instrumentalness, liveness, valence, danceability and track popularity. The resulting model did suprisingly well, reaching an overall accuracy of 0.77 (Kappa: 0.54). What shoul be taken into account, however, is that the model was trained on less data than is usually necessary when training machine learning algorithms, meaning these numbers might be a bit unreliable. A confusion matrix is printed at the bottom of this text.

As another measure of how well the model functions is to look how well it managed to reproduce the means in the data. We can look at the songs that the model predicted to be either SN old or SN new, calculate means for each feature within each group and compare those to the actual means of each feature within SN old and SN new. This is plotted on the left. The model managed to discover the same differences between SN old and new as those discussed in this storyboard: over time, we’ve moved to happier songs that are more danceable and have higher energy.

Confusion Matrix
Predicted
Real Old New
Old 25 10
New 4 22